//
//  HomeEntrepreneurTableViewCell.m
//  BigToBig
//
//  Created by liuyi on 7/19/16.
//  Copyright © 2016 cn.cloudtp. All rights reserved.
//

#import "HomeEntrepreneurTableViewCell.h"

@interface HomeEntrepreneurTableViewCell ()

@end

@implementation HomeEntrepreneurTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    
    return self;
}

#pragma mark - 创建cell
- (void)createSubviews{
    //  头像
    self.headImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, (kScreenWidth - 20)/6, (kScreenWidth - 20)/6)];
    self.headImageView.center = CGPointMake(self.headImageView.width / 2 + 10, 50);
    self.headImageView.image = [UIImage imageNamed:@"touxiang"];
    [self addSubview:self.headImageView];
    self.headImageView.layer.cornerRadius = (kScreenWidth - 20)/12;
    self.headImageView.layer.masksToBounds = YES;
    
// 标题
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.headImageView.maxX + 10, self.headImageView.y, kScreenWidth - self.headImageView.maxX - 10, self.headImageView.height /3)];
    self.titleLabel.text = @"创业生态园";
    [self addSubview:self.titleLabel];
    self.titleLabel.textAlignment = UITextAlignmentLeft;
// 描述
    self.describeLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.titleLabel.x, self.titleLabel.maxY , self.titleLabel.width, self.titleLabel.height)];
    self.describeLabel.text = @"纯天然的无污染的。";
    [self addSubview:self.describeLabel];
    self.describeLabel.font = [UIFont systemFontOfSize:12];
    self.describeLabel.textColor = [UIColor lightGrayColor];
    

// 分类名
    UILabel *groupLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.describeLabel.x, self.describeLabel.maxY, self.headImageView.width, self.titleLabel.height)];
    groupLabel.backgroundColor = COLOR_RGBA(0, 228, 161, 1);
    groupLabel.text = @"创业者";
    groupLabel.font = [UIFont systemFontOfSize:12];
    groupLabel.textAlignment = 1;
    groupLabel.textColor = [UIColor whiteColor];
    groupLabel.layer.cornerRadius = 5;
    groupLabel.layer.masksToBounds = YES;
    [self addSubview:groupLabel];
    
// 已关注图标
    UIImageView *focusImageView = [[UIImageView alloc]initWithFrame:CGRectMake(kScreenWidth / 9 * 5, groupLabel.y, self.headImageView.width / 7 * 2 + 1, self.headImageView.width / 7 * 2 + 1)];
    focusImageView.image = [UIImage imageNamed:@"guanzhu"];
    [self addSubview:focusImageView];
    
// 已关注人数
    self.focusLabel = [[UILabel alloc]initWithFrame:CGRectMake(focusImageView.maxX, focusImageView.y, kScreenWidth / 9 * 2 - focusImageView.width, focusImageView.height)];
    self.focusLabel.text = [NSString stringWithFormat:@"  已关注 : 2"];
    self.focusLabel.font = [UIFont systemFontOfSize:10];
    self.focusLabel.textColor = [UIColor lightGrayColor];
    [self addSubview:self.focusLabel];
    
    // 已查看图标
    UIImageView *funsImageView = [[UIImageView alloc]initWithFrame:CGRectMake(kScreenWidth / 9 * 7, groupLabel.y, focusImageView.width + 1, focusImageView.height + 1)];
    funsImageView.image = [UIImage imageNamed:@"fensi"];
    [self addSubview:funsImageView];
    
    // 已查看人数
    self.funsLabel = [[UILabel alloc]initWithFrame:CGRectMake(funsImageView.maxX, funsImageView.y, self.focusLabel.width , self.focusLabel.height)];
    self.funsLabel.text = [NSString stringWithFormat:@"  粉丝 : 3"];
    self.funsLabel.font = [UIFont systemFontOfSize:10];
    self.funsLabel.textColor = [UIColor lightGrayColor];
    [self addSubview:self.funsLabel];
    // 底层分割线
    UILabel *bottomLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 99, kScreenWidth, 1)];
    bottomLabel.backgroundColor = COLOR_RGBA(247, 247, 247, 1);
    [self addSubview:bottomLabel];
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
